
import * as types from '../../const/actionTypes'

const initialState = {
    loginToken: '',
    userId:'',
    avatar:'',
    name:''
};

function user(state = initialState,action) {
    switch (action.type) {
        case types.LOGIN_SUCCESS:
            return Object.assign({},state,{
                loginToken:action.loginToken,
                userId: action.userId,
                avatar:action.avatar,
                name:action.name
            });
        default:
            return state
    }
}


export default user